function betterBoard = predictPosition( cboard,w )

    % for each available board position determine which of them is the
    % better in order to maximice vHat function with weigth current vector 'w'
    
    boards=posibleBoards(cboard);
    max=intmin('int32');
    betterBoard=[];
    
    for i=1:size(boards,2)
        board=boards{i};
        vHatp=vHat(board,w);
        if(vHatp>=max)
            max=vHatp;
            betterBoard=board;
        end
    end
end

function pboards=posibleBoards(board)
    
    P2=2;
    position=find(board==0);
    pboards={};
    for p=1:size(position,1)
        pboard=board;
        pboard(position(p))=P2;
        pboards{p}=pboard;
    end
end
